<?php

/**
 * Default error controller
 * @author vsemaphore
 * @version	$Id: ErrorController.php 124 2009-06-22 12:53:06Z nazin $
 *
 */
class ErrorController extends Zend_Controller_Action {
	
	public function init() {
		$this->view->baseUrl = $this->_request->getBaseUrl();
	}
	
	public function errorAction() {
		
		$error = $this->_getParam('error_handler');
		$seriousError = false;
		
//		if($error->exception instanceof Zend_Acl_Exception) {
//			$this->_forward('page404');
//		}
		if ($error->exception instanceof MM_Exception_Fail) {
			$this->view->fail = $error->exception->getMessage();
			$this->view->links = $error->exception->getLinks();
			$this->view->header = $error->exception->getHeader();
		} else {
			$seriousError = true;
			$this->view->error = $error;
		}
		
		$this->view->seriousError = $seriousError;
		
	}
	
	public function page404Action()
	{}
	
}